# coding:utf-8

from ControlNode.NodeManager import NodeManager
from multiprocessing import Process, Queue


if __name__ == '__main__':
    url_q = Queue()
    result_q = Queue()
    store_q = Queue()
    conn_q = Queue()

    node = NodeManager()
    manager = node.start_Manager(url_q, result_q)

    url_manager_proc = Process(target=node.url_manager_proc, args=(url_q, conn_q, 'http://baike.baidu.com/view/284853',))
    result_solve_proc = Process(target=node.result_solve_proc, args=(result_q, conn_q, store_q, ))
    store_proc = Process(target=node.store_proc, args=(store_q,))

    url_manager_proc.start()
    result_solve_proc.start()
    store_proc.start()

    manager.get_server().serve_forever()

